package com.lyn.tencent_health_code.database;

import javax.persistence.*;
import java.util.List;

/**
 * @author almost
 */
@Entity
@Table(name = "tencent_health_code_user")
public class User {
    @Id
    private String id;
    @Column(unique = true)
    private String userName;
    private String userPassword;
    //<editor-fold defaultstate="collapsed" desc="delombok">
    private int type;
    private long time;
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc="delombok">
    @SuppressWarnings("all")
    public User() {
    }
    //</editor-fold>

    @SuppressWarnings("all")
    public String getId() {
        return this.id;
    }

    @SuppressWarnings("all")
    public String getUserName() {
        return this.userName;
    }

    //<editor-fold defaultstate="collapsed" desc="delombok">
    @SuppressWarnings("all")
    public String getUserPassword() {
        return this.userPassword;
    }
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc="delombok">
    @SuppressWarnings("all")
    public int getType() {
        return this.type;
    }

    @SuppressWarnings("all")
    public long getTime() {
        return this.time;
    }

    @SuppressWarnings("all")
    public void setId(final String id) {
        this.id = id;
    }

    @SuppressWarnings("all")
    public void setUserName(final String userName) {
        this.userName = userName;
    }

    @SuppressWarnings("all")
    public void setUserPassword(final String userPassword) {
        this.userPassword = userPassword;
    }

    @SuppressWarnings("all")
    public void setType(final int type) {
        this.type = type;
    }

    @SuppressWarnings("all")
    public void setTime(final long time) {
        this.time = time;
    }

    @Override
    @SuppressWarnings("all")
    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof User)) return false;
        final User other = (User) o;
        if (!other.canEqual((Object) this)) return false;
        if (this.getType() != other.getType()) return false;
        if (this.getTime() != other.getTime()) return false;
        final Object this$id = this.getId();
        final Object other$id = other.getId();
        if (this$id == null ? other$id != null : !this$id.equals(other$id)) return false;
        final Object this$userName = this.getUserName();
        final Object other$userName = other.getUserName();
        if (this$userName == null ? other$userName != null : !this$userName.equals(other$userName)) return false;
        final Object this$userPassword = this.getUserPassword();
        final Object other$userPassword = other.getUserPassword();
        if (this$userPassword == null ? other$userPassword != null : !this$userPassword.equals(other$userPassword)) return false;
        return true;
    }

    @SuppressWarnings("all")
    protected boolean canEqual(final Object other) {
        return other instanceof User;
    }

    @Override
    @SuppressWarnings("all")
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        result = result * PRIME + this.getType();
        final long $time = this.getTime();
        result = result * PRIME + (int) ($time >>> 32 ^ $time);
        final Object $id = this.getId();
        result = result * PRIME + ($id == null ? 43 : $id.hashCode());
        final Object $userName = this.getUserName();
        result = result * PRIME + ($userName == null ? 43 : $userName.hashCode());
        final Object $userPassword = this.getUserPassword();
        result = result * PRIME + ($userPassword == null ? 43 : $userPassword.hashCode());
        return result;
    }

    @Override
    @SuppressWarnings("all")
    public String toString() {
        return "User(id=" + this.getId() + ", userName=" + this.getUserName() + ", userPassword=" + this.getUserPassword() + ", type=" + this.getType() + ", time=" + this.getTime() + ")";
    }
    //</editor-fold>
}
